import axios from '@/functions/request';

function getFlowTmplList(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/tmpl/getFlowTmplList",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
// 查询流程模板
function getFlowTmpl(id) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/tmpl/getFlowTmpl",id).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function addFlowTmpl(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/tmpl/addFlowTmpl",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function editFlowTmpl(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/tmpl/editFlowTmpl",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function delFlowTmpl(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/tmpl/delFlowTmpl",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}


function deploy(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/flow/tmpl/deploy",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

export {
    getFlowTmplList,
    addFlowTmpl,
    editFlowTmpl,
    getFlowTmpl,
    delFlowTmpl,
    deploy
}
